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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/temporary_file.h

Issue 10823167: Revert "Add an IPC for PNaCl to check if the session is incognito," (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_TEMPORARY_FILE_H_ 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_TEMPORARY_FILE_H_
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_TEMPORARY_FILE_H_ 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_TEMPORARY_FILE_H_
7 7
8 #include "native_client/src/include/nacl_macros.h" 8 #include "native_client/src/include/nacl_macros.h"
9 #include "native_client/src/include/nacl_string.h" 9 #include "native_client/src/include/nacl_string.h"
10 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" 10 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
(...skipping 29 matching lines...) Expand all
40 explicit TempFile(Plugin* plugin); 40 explicit TempFile(Plugin* plugin);
41 ~TempFile(); 41 ~TempFile();
42 42
43 // Opens a writeable file IO object and descriptor referring to the file. 43 // Opens a writeable file IO object and descriptor referring to the file.
44 void Open(const pp::CompletionCallback& cb); 44 void Open(const pp::CompletionCallback& cb);
45 // Resets file position of the handle, for reuse. 45 // Resets file position of the handle, for reuse.
46 bool Reset(); 46 bool Reset();
47 47
48 // Accessors. 48 // Accessors.
49 // The nacl::DescWrapper* for the writeable version of the file. 49 // The nacl::DescWrapper* for the writeable version of the file.
50 nacl::DescWrapper* write_wrapper() { return write_wrapper_.get(); } 50 nacl::DescWrapper* get_wrapper() { return wrapper_.get(); }
51 nacl::DescWrapper* read_wrapper() { return read_wrapper_.get(); } 51 nacl::DescWrapper* release_wrapper() {
52 nacl::DescWrapper* release_read_wrapper() { 52 return wrapper_.release();
53 return read_wrapper_.release();
54 } 53 }
55 54
56 // For quota management. 55 // For quota management.
57 const nacl::string identifier() const { 56 const nacl::string identifier() const {
58 return nacl::string(reinterpret_cast<const char*>(identifier_)); 57 return nacl::string(reinterpret_cast<const char*>(identifier_));
59 } 58 }
60 59
61 private: 60 private:
62 NACL_DISALLOW_COPY_AND_ASSIGN(TempFile); 61 NACL_DISALLOW_COPY_AND_ASSIGN(TempFile);
63 62
64 Plugin* plugin_; 63 Plugin* plugin_;
65 nacl::scoped_ptr<nacl::DescWrapper> read_wrapper_; 64 nacl::scoped_ptr<nacl::DescWrapper> wrapper_;
66 nacl::scoped_ptr<nacl::DescWrapper> write_wrapper_;
67 65
68 // An identifier string used for quota request processing. The quota 66 // An identifier string used for quota request processing. The quota
69 // interface needs a string that is unique per sel_ldr instance only, so 67 // interface needs a string that is unique per sel_ldr instance only, so
70 // the identifiers can be reused between runs of the translator, start-ups of 68 // the identifiers can be reused between runs of the translator, start-ups of
71 // the browser, etc. 69 // the browser, etc.
72 uint8_t identifier_[16]; 70 uint8_t identifier_[16];
73 // A counter to dole out unique identifiers. 71 // A counter to dole out unique identifiers.
74 static uint32_t next_identifier; 72 static uint32_t next_identifier;
75 }; 73 };
76 74
77 } // namespace plugin 75 } // namespace plugin
78 76
79 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_TEMPORARY_FILE_H_ 77 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_TEMPORARY_FILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698