diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-08 18:12:09 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-08 18:12:09 +0000 |
commit | af561035f6bd3f19318d0500e936d9259a71ffe1 (patch) | |
tree | 72977304f6459adb091047978396fcd27c698771 /chrome/browser/net | |
parent | 6777a5795196c21e69169695685191e2df0eb5dd (diff) | |
download | chromium_src-af561035f6bd3f19318d0500e936d9259a71ffe1.zip chromium_src-af561035f6bd3f19318d0500e936d9259a71ffe1.tar.gz chromium_src-af561035f6bd3f19318d0500e936d9259a71ffe1.tar.bz2 |
Support chrome://blob-internals to inspect the blob storage.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3516019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r-- | chrome/browser/net/view_blob_internals_job_factory.cc | 28 | ||||
-rw-r--r-- | chrome/browser/net/view_blob_internals_job_factory.h | 20 |
2 files changed, 48 insertions, 0 deletions
diff --git a/chrome/browser/net/view_blob_internals_job_factory.cc b/chrome/browser/net/view_blob_internals_job_factory.cc new file mode 100644 index 0000000..25832a0 --- /dev/null +++ b/chrome/browser/net/view_blob_internals_job_factory.cc @@ -0,0 +1,28 @@ +// 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 "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); +} + diff --git a/chrome/browser/net/view_blob_internals_job_factory.h b/chrome/browser/net/view_blob_internals_job_factory.h new file mode 100644 index 0000000..874e2bd --- /dev/null +++ b/chrome/browser/net/view_blob_internals_job_factory.h @@ -0,0 +1,20 @@ +// 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. + +#ifndef CHROME_BROWSER_NET_VIEW_BLOB_INTERNALS_JOB_FACTORY_H_ +#define CHROME_BROWSER_NET_VIEW_BLOB_INTERNALS_JOB_FACTORY_H_ +#pragma once + +class GURL; +class URLRequest; +class URLRequestJob; + +class ViewBlobInternalsJobFactory { + public: + static bool IsSupportedURL(const GURL& url); + static URLRequestJob* CreateJobForRequest(URLRequest* request); +}; + +#endif // CHROME_BROWSER_NET_VIEW_BLOB_INTERNALS_JOB_FACTORY_H_ + |