Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: mojo/fetcher/data_fetcher.h

Issue 1356623002: mojo: Add DataURLFetcher for processing data: urls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lolgyp Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/fetcher/data_fetcher.h
diff --git a/mojo/fetcher/about_fetcher.h b/mojo/fetcher/data_fetcher.h
similarity index 59%
copy from mojo/fetcher/about_fetcher.h
copy to mojo/fetcher/data_fetcher.h
index 456125a284ef22f573cbc5e0d31380d1ee7fc8a2..b94b796489f2d7f5aaeea4f44b67c76cfdc6cd82 100644
--- a/mojo/fetcher/about_fetcher.h
+++ b/mojo/fetcher/data_fetcher.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_FETCHER_ABOUT_FETCHER_H_
-#define MOJO_FETCHER_ABOUT_FETCHER_H_
+#ifndef MOJO_FETCHER_DATA_FETCHER_H_
+#define MOJO_FETCHER_DATA_FETCHER_H_
#include "mojo/shell/fetcher.h"
@@ -14,24 +14,16 @@
namespace mojo {
namespace fetcher {
-// Implements Fetcher for about: URLs.
-class AboutFetcher : public shell::Fetcher {
+// Implements Fetcher for data: URLs.
+class DataFetcher : public shell::Fetcher {
public:
- static const char kAboutScheme[];
- static const char kAboutBlankURL[];
-
static void Start(const GURL& url, const FetchCallback& loader_callback);
private:
- AboutFetcher(const GURL& url, const FetchCallback& loader_callback);
- ~AboutFetcher() override;
-
- void BuildResponse();
+ DataFetcher(const GURL& url, const FetchCallback& loader_callback);
+ ~DataFetcher() override;
- // Must be called exactly once to run the loader callback (asynchrously). On
- // success, the ownership of this object is passed to the loader callback;
- // otherwise, the callback is run with a nullptr and this object is destroyed.
- void PostToRunCallback(bool success);
+ void BuildAndDispatchResponse();
// shell::Fetcher implementation.
const GURL& GetURL() const override;
@@ -49,10 +41,10 @@ class AboutFetcher : public shell::Fetcher {
const GURL url_;
URLResponsePtr response_;
- DISALLOW_COPY_AND_ASSIGN(AboutFetcher);
+ DISALLOW_COPY_AND_ASSIGN(DataFetcher);
};
} // namespace fetcher
} // namespace mojo
-#endif // MOJO_FETCHER_ABOUT_FETCHER_H_
+#endif // MOJO_FETCHER_DATA_FETCHER_H_
« no previous file with comments | « mojo/fetcher/DEPS ('k') | mojo/fetcher/data_fetcher.cc » ('j') | mojo/fetcher/data_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698