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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_key_utility_client.h

Issue 10204003: Use WebIDBKeyPath type in WebKit API, implement IndexedDBKeyPath type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move IndexedDBKeyPath to content namespace, formatting nits. Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_KEY_UTILITY_CLIENT_H_ 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_KEY_UTILITY_CLIENT_H_
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_KEY_UTILITY_CLIENT_H_ 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_KEY_UTILITY_CLIENT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/string16.h"
13 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
14 13
15 class IndexedDBKey; 14 class IndexedDBKey;
16 class KeyUtilityClientImpl; 15 class KeyUtilityClientImpl;
17 16
18 namespace base { 17 namespace base {
19 template <typename T> 18 template <typename T>
20 struct DefaultLazyInstanceTraits; 19 struct DefaultLazyInstanceTraits;
21 } // namespace base 20 } // namespace base
22 21
23 namespace content { 22 namespace content {
23 class IndexedDBKeyPath;
24 class SerializedScriptValue; 24 class SerializedScriptValue;
25 } 25 }
26 26
27 // Class for obtaining IndexedDBKeys from the SerializedScriptValues given 27 // Class for obtaining IndexedDBKeys from the SerializedScriptValues given
28 // an IDBKeyPath. This class is a thin singleton wrapper around the 28 // an IDBKeyPath. This class is a thin singleton wrapper around the
29 // KeyUtilityClientImpl, which does the real work. 29 // KeyUtilityClientImpl, which does the real work.
30 class IndexedDBKeyUtilityClient { 30 class IndexedDBKeyUtilityClient {
31 public: 31 public:
32 // Synchronously obtain the |keys| from |values| for the given |key_path|. 32 // Synchronously obtain the |keys| from |values| for the given |key_path|.
33 static void CreateIDBKeysFromSerializedValuesAndKeyPath( 33 static void CreateIDBKeysFromSerializedValuesAndKeyPath(
34 const std::vector<content::SerializedScriptValue>& values, 34 const std::vector<content::SerializedScriptValue>& values,
35 const string16& key_path, 35 const content::IndexedDBKeyPath& key_path,
36 std::vector<IndexedDBKey>* keys); 36 std::vector<IndexedDBKey>* keys);
37 37
38 // Synchronously inject |key| into |value| using |key_path|. Returns the new 38 // Synchronously inject |key| into |value| using |key_path|. Returns the new
39 // value. 39 // value.
40 static content::SerializedScriptValue InjectIDBKeyIntoSerializedValue( 40 static content::SerializedScriptValue InjectIDBKeyIntoSerializedValue(
41 const IndexedDBKey& key, 41 const IndexedDBKey& key,
42 const content::SerializedScriptValue& value, 42 const content::SerializedScriptValue& value,
43 const string16& key_path); 43 const content::IndexedDBKeyPath& key_path);
44 44
45 // Shut down the underlying implementation. Must be called on the IO thread. 45 // Shut down the underlying implementation. Must be called on the IO thread.
46 static void Shutdown(); 46 static void Shutdown();
47 47
48 private: 48 private:
49 friend struct base::DefaultLazyInstanceTraits<IndexedDBKeyUtilityClient>; 49 friend struct base::DefaultLazyInstanceTraits<IndexedDBKeyUtilityClient>;
50 IndexedDBKeyUtilityClient(); 50 IndexedDBKeyUtilityClient();
51 ~IndexedDBKeyUtilityClient(); 51 ~IndexedDBKeyUtilityClient();
52 52
53 bool is_shutdown_; 53 bool is_shutdown_;
54 54
55 // The real client; laziliy instantiated. 55 // The real client; laziliy instantiated.
56 scoped_refptr<KeyUtilityClientImpl> impl_; 56 scoped_refptr<KeyUtilityClientImpl> impl_;
57 }; 57 };
58 58
59 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_KEY_UTILITY_CLIENT_H_ 59 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_KEY_UTILITY_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698