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

Side by Side Diff: webkit/glue/plugins/plugin_stream_posix.cc

Issue 164537: Renames the function CreateTemporaryFilename to CreateTemporaryFile and track... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: CommandLine fix Created 11 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
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | webkit/tools/test_shell/test_shell_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "webkit/glue/plugins/plugin_stream.h" 5 #include "webkit/glue/plugins/plugin_stream.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 instance_->NPP_StreamAsFile(&stream_, temp_file_path_.value().c_str()); 44 instance_->NPP_StreamAsFile(&stream_, temp_file_path_.value().c_str());
45 } 45 }
46 46
47 size_t PluginStream::WriteBytes(const char *buf, size_t length) { 47 size_t PluginStream::WriteBytes(const char *buf, size_t length) {
48 return fwrite(buf, sizeof(char), length, temp_file_); 48 return fwrite(buf, sizeof(char), length, temp_file_);
49 } 49 }
50 50
51 bool PluginStream::OpenTempFile() { 51 bool PluginStream::OpenTempFile() {
52 DCHECK(temp_file_ == NULL); 52 DCHECK(temp_file_ == NULL);
53 53
54 if (file_util::CreateTemporaryFileName(&temp_file_path_)) 54 if (file_util::CreateTemporaryFile(&temp_file_path_))
55 temp_file_ = file_util::OpenFile(temp_file_path_, "a"); 55 temp_file_ = file_util::OpenFile(temp_file_path_, "a");
56 56
57 if (!temp_file_) { 57 if (!temp_file_) {
58 temp_file_path_ = FilePath(""); 58 temp_file_path_ = FilePath("");
59 return false; 59 return false;
60 } 60 }
61 61
62 return true; 62 return true;
63 } 63 }
64 64
65 void PluginStream::CloseTempFile() { 65 void PluginStream::CloseTempFile() {
66 file_util::CloseFile(temp_file_); 66 file_util::CloseFile(temp_file_);
67 temp_file_ = NULL; 67 temp_file_ = NULL;
68 } 68 }
69 69
70 bool PluginStream::TempFileIsValid() { 70 bool PluginStream::TempFileIsValid() {
71 return temp_file_ != NULL; 71 return temp_file_ != NULL;
72 } 72 }
73 73
74 } // namespace NPAPI 74 } // namespace NPAPI
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | webkit/tools/test_shell/test_shell_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698