summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/view_blob_internals_job_factory.cc
blob: 847d70d2eca7cce107053216d530a0bc38966f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/net/view_blob_internals_job_factory.h"

#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/chrome_blob_storage_context.h"
#include "chrome/common/url_constants.h"
#include "net/url_request/url_request.h"
#include "webkit/blob/view_blob_internals_job.h"

// static.
bool ViewBlobInternalsJobFactory::IsSupportedURL(const GURL& url) {
  return StartsWithASCII(url.spec(),
                         chrome::kBlobViewInternalsURL,
                         true /*case_sensitive*/);
}

// static.
URLRequestJob* ViewBlobInternalsJobFactory::CreateJobForRequest(
    URLRequest* request) {
  webkit_blob::BlobStorageController* blob_storage_controller =
      static_cast<ChromeURLRequestContext*>(request->context())->
          blob_storage_context()->controller();
  return new webkit_blob::ViewBlobInternalsJob(
      request, blob_storage_controller);
}