Home | History | Annotate | Download | only in net
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/net/view_blob_internals_job_factory.h"
      6 
      7 #include "base/string_util.h"
      8 #include "chrome/browser/net/chrome_url_request_context.h"
      9 #include "chrome/common/url_constants.h"
     10 #include "content/browser/chrome_blob_storage_context.h"
     11 #include "net/url_request/url_request.h"
     12 #include "webkit/blob/view_blob_internals_job.h"
     13 
     14 // static.
     15 bool ViewBlobInternalsJobFactory::IsSupportedURL(const GURL& url) {
     16   return StartsWithASCII(url.spec(),
     17                          chrome::kBlobViewInternalsURL,
     18                          true /*case_sensitive*/);
     19 }
     20 
     21 // static.
     22 net::URLRequestJob* ViewBlobInternalsJobFactory::CreateJobForRequest(
     23     net::URLRequest* request) {
     24   webkit_blob::BlobStorageController* blob_storage_controller =
     25       static_cast<ChromeURLRequestContext*>(request->context())->
     26           blob_storage_context()->controller();
     27   return new webkit_blob::ViewBlobInternalsJob(
     28       request, blob_storage_controller);
     29 }
     30