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

Side by Side Diff: components/translate/content/browser/data_file_browser_cld_data_provider.h

Issue 333603002: Modularize Compact Language Detector 2 (CLD2) data sources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Takashi's comments and virtual destructors Created 6 years, 6 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER _H_
6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER _H_
7
8 #include "base/files/file.h"
9 #include "base/files/file_path.h"
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "components/translate/content/browser/browser_cld_data_provider.h"
13
14 namespace content {
droger 2014/06/19 16:13:19 namespace translate
Andrew Hayden (chromium.org) 2014/06/19 19:49:30 Done.
15
16 class DataFileBrowserCldDataProvider : public BrowserCldDataProvider {
17 public:
18 explicit DataFileBrowserCldDataProvider(content::RenderViewHost*);
19 ~DataFileBrowserCldDataProvider();
20 // BrowserCldDataProvider implementations:
21 bool OnMessageReceived(const IPC::Message&);
droger 2014/06/19 16:13:19 virtual and OVERRIDE?
Andrew Hayden (chromium.org) 2014/06/19 19:49:30 I don't currently plan to have any more subclasses
22 void OnCldDataRequest();
23 void SendCldDataResponse();
24
25 private:
26 void SendCldDataResponseInternal(const base::File*,
27 const uint64,
28 const uint64);
29 void OnCldDataRequestInternal();
30
31 content::RenderViewHost* render_view_host;
32 base::WeakPtrFactory<DataFileBrowserCldDataProvider> weak_pointer_factory_;
33
34 DISALLOW_COPY_AND_ASSIGN(DataFileBrowserCldDataProvider);
35 };
36
37 // Sets the data file that this data provider will use to fulfill requests.
38 // This method does nothing if the specified path is equal to the path that
39 // is already configured. Otherwise, the specified path is cached and
40 // subsequent requests for data will attempt to load CLD data from the file
41 // at the specified path.
42 // This method is threadsafe.
43 void SetCldDataFilePath(const base::FilePath& filePath);
44
45 // Returns the path most recently set by SetDataFilePath. The initial value
46 // prior to any such call is the empty path.
47 // This method is threadsafe.
48 base::FilePath GetCldDataFilePath();
49
50 } // namespace content
51
52 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVI DER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698