Signature of StartDataRequest has changed

This commit is contained in:
Cheng Zhao 2017-01-23 14:55:06 +09:00
parent eb89edbf5b
commit 804d56e139

View file

@ -14,7 +14,6 @@
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
namespace brightray { namespace brightray {
namespace { namespace {
@ -62,19 +61,21 @@ class BundledDataSource : public content::URLDataSource {
return kChromeUIDevToolsHost; return kChromeUIDevToolsHost;
} }
void StartDataRequest(const std::string& path, void StartDataRequest(
int render_process_id, const std::string& path,
int render_frame_id, const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
const GotDataCallback& callback) override { const GotDataCallback& callback) override {
// Serve request from local bundle. // Serve request from local bundle.
std::string bundled_path_prefix(kChromeUIDevToolsBundledPath); std::string bundled_path_prefix(kChromeUIDevToolsBundledPath);
bundled_path_prefix += "/"; bundled_path_prefix += "/";
if (base::StartsWith(path, bundled_path_prefix, if (base::StartsWith(path, bundled_path_prefix,
base::CompareCase::INSENSITIVE_ASCII)) { base::CompareCase::INSENSITIVE_ASCII)) {
StartBundledDataRequest(path.substr(bundled_path_prefix.length()), StartBundledDataRequest(path.substr(bundled_path_prefix.length()),
render_process_id, render_frame_id, callback); callback);
return; return;
} }
// We do not handle remote and custom requests.
callback.Run(nullptr); callback.Run(nullptr);
} }
@ -94,11 +95,8 @@ class BundledDataSource : public content::URLDataSource {
return true; return true;
} }
void StartBundledDataRequest( void StartBundledDataRequest(const std::string& path,
const std::string& path, const GotDataCallback& callback) {
int render_process_id,
int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) {
std::string filename = PathWithoutParams(path); std::string filename = PathWithoutParams(path);
base::StringPiece resource = base::StringPiece resource =
content::DevToolsFrontendHost::GetFrontendResource(filename); content::DevToolsFrontendHost::GetFrontendResource(filename);