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

Unified Diff: chrome/common/web_resource/web_resource_unpacker.h

Issue 19224002: Get rid of single process code path in json_asynchronous_unpacker.cc. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: move web_resource_unpacker Created 7 years, 5 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
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/web_resource/web_resource_unpacker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/web_resource/web_resource_unpacker.h
===================================================================
--- chrome/common/web_resource/web_resource_unpacker.h (revision 211642)
+++ chrome/common/web_resource/web_resource_unpacker.h (working copy)
@@ -1,57 +0,0 @@
-// Copyright (c) 2011 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.
-
-// This class is called by the WebResourceService in a sandboxed process
-// to unpack data retrieved from a web resource feed. Right now, it
-// takes a string of data in JSON format, parses it, and hands it back
-// to the WebResourceService as a list of items. In the future
-// it will be set up to unpack and verify image data in addition to
-// just parsing a JSON feed.
-
-#ifndef CHROME_COMMON_WEB_RESOURCE_WEB_RESOURCE_UNPACKER_H_
-#define CHROME_COMMON_WEB_RESOURCE_WEB_RESOURCE_UNPACKER_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-
-namespace base {
-class DictionaryValue;
-}
-
-class WebResourceUnpacker {
- public:
- static const char* kInvalidDataTypeError;
- static const char* kUnexpectedJSONFormatError;
-
- explicit WebResourceUnpacker(const std::string &resource_data);
- ~WebResourceUnpacker();
-
- // This does the actual parsing. In case of an error, error_message_
- // is set to an appropriate value.
- bool Run();
-
- // Returns the last error message set by Run().
- const std::string& error_message() { return error_message_; }
-
- // Gets data which has been parsed by Run().
- base::DictionaryValue* parsed_json() {
- return parsed_json_.get();
- }
-
- private:
- // Holds the string which is to be parsed.
- std::string resource_data_;
-
- // Holds the result of JSON parsing of resource_data_.
- scoped_ptr<base::DictionaryValue> parsed_json_;
-
- // Holds the last error message produced by Run().
- std::string error_message_;
-
- DISALLOW_COPY_AND_ASSIGN(WebResourceUnpacker);
-};
-
-#endif // CHROME_COMMON_WEB_RESOURCE_WEB_RESOURCE_UNPACKER_H_
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/web_resource/web_resource_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698